I am using mlogit to model a continuous variable x that has a two power fractional polynomial transformation.
I ould like to graph the relationship of x to the log odds both unadjusted and adjusted for some other covariates.
I have been able to produce the graph for the unadjusted model but I am unsure how to do this while adjusting for the other variables in the model.
Tha adjusted graph is not smooth - is there a way to get the log odds with adjusted predictions say on the mean of the other variable in the model?
Many thanks for you help
Kevan
Please see attached code and graphs:
I ould like to graph the relationship of x to the log odds both unadjusted and adjusted for some other covariates.
I have been able to produce the graph for the unadjusted model but I am unsure how to do this while adjusting for the other variables in the model.
Tha adjusted graph is not smooth - is there a way to get the log odds with adjusted predictions say on the mean of the other variable in the model?
Many thanks for you help
Kevan
Please see attached code and graphs:
Code:
mlogit outcome x_1 x_2 , baseoutcome(0) predict fp1 , xb outcome(1) predict fp2 , xb outcome(2) twoway (line fp1 fp2 x, sort lwidth(medthick ..) lcolor(gs4 ..) ) mlogit outcome x_1 x_2 y i.z, baseoutcome(0) predict fp3 , xb outcome(1) predict fp4 , xb outcome(2) twoway (line fp3 fp4 x, sort lwidth(medthick ..) lcolor(gs4 ..) )